<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Goods extends Model
{
//    绑定数据表
    protected $table='month_exam_goods';

    /**
     * @return \think\Paginator
     * @throws \think\exception\DbException
     * 分页查询所有数据
     */
    public function goodsList(){
        return $this->paginate(20);
    }


    /**
     * @param $id
     * @return array|bool|\PDOStatement|string|Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * 根据id查询指定商品
     */
    public function goodsInfo($id){
        return $this->find($id);
    }
}
